import java.io.Console;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.sql.SQLOutput;
import java.util.*;

/**
 * This program demonstrates console input.
 * @version 1.10 2004-02-10
 * @author Cay Horstmann
 */
public class InputTest
{
   public static void main(String[] args) throws IOException {
      Scanner in = new Scanner(System.in);

      // get first input
      System.out.print("What is your name? ");
      String name = in.nextLine();

      // get second input
      System.out.print("How old are you? ");
      int age = in.nextInt();

      // display output on console
      System.out.println("Hello, " + name + ". Next year, you'll be " + (age + 1));

      Scanner in1 = new Scanner(Path.of("E:\\Java\\corejava\\v1ch03\\InputTest\\myfile.txt"), StandardCharsets.UTF_8);
      String str = in1.nextLine();
      System.out.println(str);
      PrintWriter out = new PrintWriter("E:\\Java\\corejava\\v1ch03\\InputTest\\myfile1.txt", StandardCharsets.UTF_8);
      out.println(333);

   }
}
